#!/bin/bash
#所有者：北城半夏
#当前版本
#v1.0.1
######################################################
#定义变量
disk1="/dev/sdb /dev/sdc"
log="/opt/ceph_log"
#执行脚本路径，必须与ceph.conf目录下执行
path="/root/ceph-cluster"
######################################################
[ ! -d ${log} ] && mkdir -p ${log}
cd ${path}
{% for host in groups['all'] %}
for i in $disk1
do
      ceph-deploy disk  zap ceph_{{ host| regex_replace('\.', '_') }} ${i} >${log}/zap.log
      sleep 5
      ceph-deploy osd create ceph_{{ host| regex_replace('\.', '_') }} --data ${i} > ${log}/create.log
done
{% endfor %}
#https://www.jianshu.com/p/d2676670e301
